﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Pages_Default : System.Web.UI.Page
{
    algemeen alg = new algemeen();
    


    protected void Page_Load(object sender, EventArgs e)
    {
    }
 
    protected void Button1_Click1(object sender, EventArgs e)
    {

        string sql_query = "SELECT P.pakket_id ,S.naam, T.tijd ";
        sql_query += "FROM [pakket] P, [route] R, [trackandtrace]T, [status] S ";
        sql_query += "WHERE P.pakket_id = R.pakket_id ";
        sql_query += "AND   R.route_id = T.route_id ";
        sql_query += "AND   T.status_id = S.status_id ";
        sql_query += "AND   P.pakket_id = '" + TextBox1.Text.ToString() + "' ";
        sql_query += "ORDER BY T.tijd DESC";

        using (SqlConnection connection = new SqlConnection(alg.sql_string))
        using (SqlCommand command = new SqlCommand(sql_query, connection))
        {
            connection.Open();
            info.DataSource = command.ExecuteReader(
              CommandBehavior.CloseConnection |
              CommandBehavior.SingleResult);
            info.DataBind();
        }
        
    }
    
}
